<?php

class Adept_Filter_Chain 
{
    
    protected $filters = array();
    
    protected $current = 0;
    
    /**
     * @param Adept_Filter_IFilter $filter
     */
    public function append($filter)
    {
        $this->filters[] = $filter;
    }
    
    public function next()
    {
        if (!isset($this->filters[$this->current])) {
            return ;
        }
        $nextFilter = $this->filters[$this->current++];
        return $nextFilter->process($this);
    }
    
    public function getNextFilter() 
    {
        return $this->filters[$this->current + 1];
    }    
    
    public function getCurrentFilter() 
    {
        return $this->filters[$this->current];
    }    
    
    
}